// [{
// 	Name: '',
// 	Areas: ['', ''],
// 	Menus: [{
// 		Name: '',
// 		Link: '',
// 		Icon: '',
// 		IsOpenNewTab: false,
// 		ChildMenus: []
// 	}]
// }]


define(['text', 'text!/public/modules/layui-admin-menu/layui-admin-menu-template.html', 'menu'], function(text, template, menus) {

	var LayuiAdminMenu = Vue.extend({
		template: template,
		data: function() {
			return {
				menus: [],
				currentArea: 'shake.developer',

			}
		},
		methods: {
			clickNav: function($event) {
				var elemet = $($event.target || $event.srcElement).parent();
				!elemet.hasClass('layui-nav-itemed') ? elemet.addClass('layui-nav-itemed') : elemet.removeClass('layui-nav-itemed');
			}
		},
		ready: function() {
			var that = this;
			$.each(menus, function(index, menu) {
				if (menu.Areas.indexOf(that.currentArea) > -1) that.menus = menu.Menus;
			});
		}
	});
	return LayuiAdminMenu;

});